package com.yunxi.controller.otd;

import com.yunxi.core.web.ApiResult;
import com.yunxi.core.web.ResponseUtil;
import com.yunxi.otd.pojo.OtdNodeConfigEditVO;
import com.yunxi.otd.service.OtdNodeConfigDubboService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import java.util.Map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * OTD节点 前端控制器
 * </p>
 *
 * @author XUQI
 * @since 2019-08-22
 */
@RestController
@RequestMapping("/admin/otd/node")
@Api(tags = "OTD:NODE", description = "OTD节点")
public class OtdNodeConfigController {

    private static final Logger logger = LoggerFactory.getLogger(OtdNodeConfigController.class);

    @Autowired
    OtdNodeConfigDubboService otdNodeConfigDubboService;

    @GetMapping("/list")
    @ApiOperation(value = "查询")
    public ApiResult listAll(@RequestParam Map<String, Object> map) {
        return otdNodeConfigDubboService.queryAllNode(map);
    }

    @PostMapping("/edit")
    public ApiResult edit(@RequestBody OtdNodeConfigEditVO editVO) {
        otdNodeConfigDubboService.update(editVO);
        return ResponseUtil.ok();
    }

}
